package com.danco.training.zaneuskaya.domain.comparator;

import java.io.Serializable;
import java.util.Comparator;

import com.danco.training.zaneuskaya.domain.entity.Claim;

public class ClaimComaratorByClaimAmount implements Comparator<Claim>,Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -600845488767531012L;

	public int compare(Claim o1, Claim o2) {

		int amount1 = o1.getClaimAmount();
		int amount2 = o2.getClaimAmount();

		if (amount1 > amount2) {
			return 1;
		} else if (amount1 < amount2) {
			return -1;
		}
		return 0;

	}

}
